package modules
{
	import asf.forms.Form;
	import asf.sections.Section;
	import asf.utils.Align;
	import asf.views.View;
	
	import sample.components.SendButton;
	import sample.viewassets.contact.ContactForm;

	public class ContactSectionView extends View
	{
		private var button:SendButton;
		private var frm:Form;
		
		public function ContactSectionView( p_section:Section )
		{
			super( p_section );
			
			graphics.beginFill( 0xCECECE );
			graphics.drawRect( 0, 0, 600, 400 );
			
			initForm( );
		}
		
		private function initForm( ):void
		{
			frm = this.section.forms.contactForm;
			
			frm.addFields( );
			( frm.view as ContactForm ).init( frm );
			
			addChild( frm.view );
			
			( frm.view as ContactForm ).show( 1000 );
			
			Align.place( frm.view, Align.TOP + Align.LEFT, { margin_left: 150, margin_top: 20 } );
		}
		
		public override function dispose( ):void
		{
			removeChild( frm.view );
			
			frm = null;
			
			super.dispose( );
		}
	}
}